Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more support for OpenBSD #437

Merged
merged 1 commit into from
Sep 15, 2021
Merged

Conversation

hargoniX
Copy link
Member

Previously the backtrace example would print a useless backtrace:

     Running `target/debug/examples/backtrace`
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>

Now its slightly more useful

     Running `target/debug/examples/backtrace`
   0: backtrace::main
             at examples/backtrace.rs:4:22
   1: core::ops::function::FnOnce::call_once
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/core/src/ops/function.rs:227:5
   2: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/std/src/sys_common/backtrace.rs:125:18
   3: std::rt::lang_start::{{closure}}
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/std/src/rt.rs:49:18
   4: std::rt::lang_start_internal
   5: std::rt::lang_start
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/std/src/rt.rs:48:5
   6: main
   7: <unknown>

I do not know for sure why it cannot trace back to before main, could be a bug
in backtrace-rs or a security measure by OpenBSD. However for the average user
this step of the backtrace should be irrelevant on OpenBSD so this is still a
great improvement to before.

Previously the backtrace example would print a useless backtrace:
     Running `target/debug/examples/backtrace`
   0: <unknown>
   1: <unknown>
   2: <unknown>
   3: <unknown>
   4: <unknown>
   5: <unknown>
   6: <unknown>
   7: <unknown>
Now its slightly more useful
     Running `target/debug/examples/backtrace`
   0: backtrace::main
             at examples/backtrace.rs:4:22
   1: core::ops::function::FnOnce::call_once
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/core/src/ops/function.rs:227:5
   2: std::sys_common::backtrace::__rust_begin_short_backtrace
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/std/src/sys_common/backtrace.rs:125:18
   3: std::rt::lang_start::{{closure}}
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/std/src/rt.rs:49:18
   4: std::rt::lang_start_internal
   5: std::rt::lang_start
             at /usr/obj/ports/rust-1.54.0/rustc-1.54.0-src/library/std/src/rt.rs:48:5
   6: main
   7: <unknown>

I do not know for sure why it cannot trace back to before main, could be a bug
in backtrace-rs or a security measure by OpenBSD. However for the average user
this step of the backtrace should be irrelevant on OpenBSD so this is still a
great improvement to before.
@alexcrichton
Copy link
Member

Indeed that is much better than before, thanks!

@alexcrichton alexcrichton merged commit cc89bb6 into rust-lang:master Sep 15, 2021
@hargoniX
Copy link
Member Author

Do I have to do anything special to get the upstream rustc to use this updated version of backtrace? Or is it just regularly updated as a chore for every release? @alexcrichton

@alexcrichton
Copy link
Member

The library/backtrace submodule in rust-lang/rust needs to be updated to pull in these changes, and at this time there's no automatic/other update process so feel free to send a PR!

hargoniX added a commit to hargoniX/rust that referenced this pull request Sep 15, 2021
rust-lang/backtrace-rs#437 fixed backtraces in
OpenBSD -> update it here as well so OpenBSD Rust code can produce
proper backtraces.
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 16, 2021
Update the backtrace crate

rust-lang/backtrace-rs#437 fixed backtraces in
OpenBSD -> update it here as well so OpenBSD Rust code can produce
proper backtraces.
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 16, 2021
Update the backtrace crate

rust-lang/backtrace-rs#437 fixed backtraces in
OpenBSD -> update it here as well so OpenBSD Rust code can produce
proper backtraces.
Manishearth added a commit to Manishearth/rust that referenced this pull request Sep 16, 2021
Update the backtrace crate

rust-lang/backtrace-rs#437 fixed backtraces in
OpenBSD -> update it here as well so OpenBSD Rust code can produce
proper backtraces.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants